<include file="Core:Public:header" />
<link rel="stylesheet" href="__PUBLIC__/css/treeview/jquery.treeview.css" type="text/css">
<script type="text/javascript" src="__PUBLIC__/js/treeview/jquery.treeview.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/treeview/jquery.treeview.edit.js"></script>
<script type="text/javascript">
	$(function() {
		$("#browser").treeview();
	})
</script>

<style type="text/css">
.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle}
</style>
{:W('Navigation')}
<div class="body-right">
	<div class="row-table">
		<div class="row-table-title">组织架构</div>
		<div class="row-table-body">
			<p class="form-title">
				<a class="pull-right btn btn-primary btn-xs" href="{:U('hrm/structure/addposition')}" style="margin-left:10px">添加岗位</a>
				<a class="pull-right btn btn-primary btn-xs" href="{:U('hrm/structure/adddepartment')}">添加部门</a>
				<a href="{:U('hrm/structure/department')}" >部门岗位图</a> | 
				上下级关系图
			</p>
			<p class="navbar-text">{$tree_code}</p>
		</div>
	</div>
</div>
<div class="clear"></div>
<script type="text/javascript">
	$(function(){
		$(".treeview .file").hover(function(){
			rel = $(this).attr('rel');
			$('#control_file' + rel).show();
		},function(){
			rel = $(this).attr('rel');
			$('#control_file' + rel).hide();
		});
		$(".treeview .folder").hover(function(){
			rel = $(this).attr('rel');
			$('#control_folder' + rel).show();
		},function(){
			rel = $(this).attr('rel');
			$('#control_folder' + rel).hide();
		});
		$(".position_delete").click(function(){
			if(confirm("确定删除该岗位吗?")){
				id = $(this).attr('rel');
				window.location="{:U('hrm/structure/deletePosition','id=')}"+id;
			}
		});
		$('.control_edit').click(function(){
			position_id = $(this).attr('rel');
			$('#alert').modal({
			show:true,
			remote:'{:U("core/user/editControl","id=")}'+position_id
			});
		});
		$('.position_edit').click(function(){
			position_id = $(this).attr('rel');
			$('#alert').modal({
			show:true,
			remote:'{:U("hrm/structure/editPosition","id=")}'+position_id
			});
		});
	});
</script>
<include file="Core:Public:alert" />
<include file="Core:Public:footer" />